// stores/serviceStore.js
import { defineStore } from 'pinia'

export const useServiceStore = defineStore('service', {
    state: () => ({
        // 存储 serviceId
        serviceId: ''
    }),
    actions: {
        // 设置 serviceId
        setServiceId(id) {
            this.serviceId = id
        },
        // 清空 serviceId（可选，如退出相关页面时）
        clearServiceId() {
            this.serviceId = ''
        }
    },
    // 可选：持久化存储（刷新页面后不丢失）
    persist: {
        enabled: true,
        strategies: [{ storage: localStorage }]
    }
})